package com.veryUsedCar.controller;

import com.veryUsedCar.data.Result;
import com.veryUsedCar.entity.CharnnelType;
import com.veryUsedCar.service.CharnnelTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
@Api("分类导航栏接口")
@RequestMapping("charnneltype")
@RefreshScope//配置刷新
public class CharnnelTypeController {
    @Autowired
    private CharnnelTypeService charnnelTypeService;

    @GetMapping
    @ApiOperation("分类导航栏查询")
    public Result findType(){
        List<CharnnelType> typeList= charnnelTypeService.findType();
        return Result.OK().setData(typeList);
    }
}
